package com.example.demo.message;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MessageProducer {

    @Autowired
    private RedisTemplate<String,Object> redisTemplate;

    public void lPush(String msg) {
        redisTemplate.opsForList().leftPush(MessageConsumer.MESSAGE_KEY, msg);
    }
}
